home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / graphics / 3dvect37.zip / QB.ZIP / MSIN.BAS < prev    next >
BASIC Source File  |  1980-01-10  |  971b  |  48 lines

  1. REM Warning, this file is old, (I've lost my updated version for 4096 angles)
  2.  
  3. a$ = "0123456789ABCDEF"
  4. w$ = "        dw  "
  5. s$ = "sinus   dw  "
  6. c$ = "cosinus dw  "
  7.  
  8. REM use: qbasic msin.bas>sin.inc  to dump to disk
  9.  
  10. c = 0
  11. PRINT "; sine tables: 1024 entries each.  therefore 90 degrees is now 256[si]"
  12. PRINT "; 180 = 512, 360 = 1024 = 0.  and ax,03FFh to truncate angle"
  13. PRINT : PRINT s$;
  14.  
  15. FOR z = 0 TO 359.98 + 90 STEP 360 / 1024
  16.  
  17.  x = INT(SIN(z / 360 * 2 * 3.14159265#) * 256 + .5)
  18.  
  19.  IF x = 256 THEN PRINT "00100h"; : GOTO 78
  20.  
  21.  q$ = "000"
  22.  IF x < 0 THEN q$ = "0FF": x = 256 + x
  23.  
  24.  y = INT(x / 16)
  25.  
  26.  PRINT q$; MID$(a$, y + 1, 1); MID$(a$, (x / 16 - INT(x / 16)) * 16 + 1, 1); "h";
  27.  
  28. 78
  29.  
  30.  c = c + 1
  31.  IF c < 8 THEN PRINT ","; : GOTO 91
  32.  
  33.  c = 0
  34.  q = z - 2.4609
  35.  u = INT(q * 1000) / 1000
  36.  
  37.  IF ABS(z - 90) < 1 THEN PRINT " ;"; u: PRINT : PRINT c$; : GOTO 91
  38.  
  39.  PRINT " ;"; u
  40.  IF z > 359 + 90 THEN GOTO 91
  41.  
  42.  PRINT ; w$;
  43.  
  44. 91
  45.  
  46.  NEXT z
  47.  
  48.